package com.jin.flashsaled.RabbitMQ;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class RabbitSend {

    @Autowired
    private RabbitTemplate rabbitTemplate;
    public void send(Object message)
    {
        //rabbitTemplate.send();只能发送基本类型。



        //发送时底层自动把message对象，序列化和反序列化
        rabbitTemplate.convertAndSend("seckillExchange","queue.seckill",message);
    }
}
